#ifndef __SYS_HAL_MAILBOX_H
#define __SYS_HAL_MAILBOX_H
#include "mailbox.h"
#include "DrvUART010.h"

#define HIFI_MOCK_TEST     0

#define MAILBOX_RX_THRESHOLD_VALUE					7
#define MAILBOX_TX_THRESHOLD_VALUE					7

#define MAILBOX_MESSAGE_QUEUE_NUMBER				8


#define MAILBOX_TASK_STACK 							0x1000
#define MAILBOX_MODULE_MAX 							8

typedef enum {
	MAILBOX_NONE = 0,
	MAILBOX_FLASH,
	MAILBOX_PLAY,
	MAILBOX_RECORD,
	MAILBOX_CONFIG,

	MAILBOX_CTR_HIFI_INITED,
	MAILBOX_CTR_SLEEP,
	MAILBOX_CTR_SLEEP_DONE,
	MAILBOX_CTR_WAKEUP,
	MAILBOX_KWS_START,
	MAILBOX_KWS_STOP,
	MAILBOX_KWS_RESULT,
	MAILBOX_KWS_TIMEOUT,
	MAILBOX_PREPROC_WAKENED,
	MAILBOX_PREPROC_SLEEP,
	MAILBOX_WATCH_DOG_FEED,

	MAILBOX_AUDIO_PLAY,
	MAILBOX_AUDIO_STOP,
	MAILBOX_CONFIG_READ,
	MAILBOX_CONFIG_DATA,
	MAILBOX_EASYFLASH,
	MAILBOX_MAX
}mailbox_serial_number_t;

typedef int (*mailbox_callback_t)(char *args, mailbox_message *message);
extern int sys_hal_mailbox_lock(mailbox_lock lock);
extern int sys_hal_mailbox_unlock(mailbox_lock lock);
extern int sys_hal_mailbox_is_lock(mailbox_lock lock);
extern int sys_hal_mailbox_register_callback(mailbox_serial_number_t number, mailbox_callback_t mailbox_callback, char *args);
extern int sys_hal_mailbox_send(mailbox_message *message);
extern int sys_hal_mailbox_init(void);
#endif
